//
//  AirportDetailsCoordinator.swift
//  CitySearch
//
//  Created by guotonglin on 2020/6/9.
//  Copyright © 2020 guotonglin. All rights reserved.
//

import Foundation

class AirportDetailsCoordinator: BaseCoordinator {
    
    private let router: Routing
    private let model: AirportModel
    
    init(model: AirportModel, router: Routing) {
        self.model = model
        self.router = router
    }
    
    override func start() {
        let viewConroller = AirportsDetailsViewController.instantiate()
        let locationService = LocationService.shared
        viewConroller.viewModelBuilder = { [locationService] input in
            AirportDetailViewModel(input: input, dependencies: (model: self.model, currentLocation: locationService.currentLocation))
        }
        router.present(viewConroller, isAnimated: true, onDismiss: isCompleted)
    }
    
}
